import { http } from "@/utils/http";
type Result = {
  current_page: number;
  result?: any;
  per_page?: number;
  total?: number;
};
type ResultDelete = {
  code: number;
  msg: string;
};
type ResultCreate = {
  code: number;
  msg: string;
};
/** 供件台PLC列表 */ /*2025-03-19废弃*/
export const getSupplyPlcListApi = (params?: object) => {
  return http.request<Result>("get", "/dashboard/supplyPlc/list", {
    params
  });
};
export const getDeviceListApi = (params?: object) => {
  return http.request<Result>("get", "/dashboard/device/list", {
    params
  });
};
/** 添加 */ /*2025-03-19废弃*/
export const createSupplyPlcApi = (data?: object) => {
  return http.request<ResultCreate>("post", "/dashboard/supplyPlc/store", {
    data
  });
};
export const createDeviceApi = (data?: object) => {
  return http.request<ResultCreate>("post", "/dashboard/device/store", {
    data
  });
};
/** 修改 */ /*2025-03-19废弃*/
export const updateSupplyPlcApi = (data?: object) => {
  return http.request<ResultCreate>("put", "/dashboard/supplyPlc/update", {
    data
  });
};
export const updateDeviceApi = (data?: object) => {
  return http.request<ResultCreate>("put", "/dashboard/device/update", {
    data
  });
};
/** 删除 */ /*2025-03-19废弃*/
export const delSupplyPlcApi = (params?: object) => {
  return http.request<ResultDelete>("delete", "/dashboard/supplyPlc/delete", {
    params
  });
};
export const delDeviceApi = (params?: object) => {
  return http.request<ResultDelete>("delete", "/dashboard/device/delete", {
    params
  });
};
type Show = {
  code: number;
  msg: string;
  result?: any;
};
/** 详情 */ /*2025-03-19废弃*/
export const getSupplyPlcShowApi = (params?: object) => {
  return http.request<Show>("get", "/dashboard/supplyPlc/show", {
    params
  });
};
export const getDeviceShowApi = (params?: object) => {
  return http.request<Show>("get", "/dashboard/device/show", {
    params
  });
};
/** 新一代格口映射列表 */
export const getWheelLatticeListApi = (params?: object) => {
  return http.request<Result>("get", "/dashboard/wheelLattice/list", {
    params
  });
};
/** 添加 */
export const createWheelLatticeApi = (data?: object) => {
  return http.request<ResultCreate>("post", "/dashboard/wheelLattice/store", {
    data
  });
};
/** 修改 */
export const updateWheelLatticeApi = (data?: object) => {
  return http.request<ResultCreate>("put", "/dashboard/wheelLattice/update", {
    data
  });
};
/** 删除 */
export const delWheelLatticeApi = (params?: object) => {
  return http.request<ResultDelete>(
    "delete",
    "/dashboard/wheelLattice/delete",
    {
      params
    }
  );
};

/** 详情 */
export const getWheelLatticeShowApi = (params?: object) => {
  return http.request<Show>("get", "/dashboard/wheelLattice/show", {
    params
  });
};

/** 摆轮部件日志列表接口 */
export const getWheelDeviceLogListApi = (params?: object) => {
  return http.request<Result>("get", "/dashboard/wheelDeviceLog/list", {
    params
  });
};
/** 摆轮部件日志详情 */
export const getWheelDeviceLogShowApi = (params?: object) => {
  return http.request<Show>("get", "/dashboard/wheelDeviceLog/show", {
    params
  });
};
